﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace ProjectTW.Foliage
{
    [ExecuteInEditMode]
    public abstract class TargetBase : ThreadItem
    {
        private static List<TargetBase> s_WorldTargets = new List<TargetBase>();

        protected virtual bool UseMultithreadedCheck
        {
            get
            {
                return true;
            }
        }

        protected virtual void Awake()
        {
        }

        protected override void OnEnable()
        {
            base.OnEnable();
            s_WorldTargets.Add(this);
        }

        protected override void OnDisable()
        {
            base.OnDisable();
            s_WorldTargets.Remove(this);
        }

        public virtual bool InDistance(FoliageReceiver seeker)
        {
            return true;
        }

        public virtual Vector3 FixPosition(Vector3 position)
        {
            return position;
        }
    }
}
